Fix exception because of premature handle closing in V2 forkers#1842
Merged
Fix exception because of premature handle closing in V2 forkers#1842
Conversation
30e9fd9 to
fdf1488
Compare
Contributor
Author
|
I'm thinking now that maybe we could even share the same ledgerseq between the LedgerDB and the forker, and commit the whole thing, then closing only the leftovers from the LedgerDB. This would remove the |
Contributor
Author
Actually we can't benefit from this because the LedgerDB might be pruned in the meantime, so we will have to do the same dance. |
fdf1488 to
c362299
Compare
geo2a
approved these changes
Feb 3, 2026
c362299 to
92c330a
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 3, 2026
Part of #1842 that I would like to merge separatedly.
e116f59 to
6fb6220
Compare
jasagredo
commented
Feb 9, 2026
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/LedgerDB/V2/Forker.hs
Outdated
Show resolved
Hide resolved
dnadales
approved these changes
Feb 9, 2026
6fb6220 to
f67b8c7
Compare
f67b8c7 to
cc1364e
Compare
cc1364e to
d5e77c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manifested here: https://github.com/IntersectMBO/ouroboros-consensus/actions/runs/21365715331/job/61496793074?pr=1841
Finally I know what is going on and it is quite convoluted:
A(2),B(4),C(5). They belong to these branches:A(2)is there only because we forgot to close it.A(2 -> 6), B(4 -> 7), C(5 -> 8), BUT we only update the rIDs known to the handles forBandC, so they think they are the previous resourceAis allocated at rID6and it is not made aware that it was transferredBis allocated at rID7but it is told its new rID is instead6Cis allocated at rID8but it is told its new rID is instead7C, so we close it.Cwill release resource7as that is the rID it thinks it belongs to. But that actually closesB.Bit will be closed, AND it will report in the exception that6was closed because that is what it thinks is its rID. It was7but it didn't know that.So albeit the logic being quite complicated, the solution is in fact making sure that we close
Awhen we discard that fork.